p <- df %>%
select(run_number = .run.number., chance_imp = importance.of.chance,
step = .step., contains("gini")) %>%
pivot_longer(contains("gini")) %>%
mutate(chance_imp = factor(chance_imp, labels = chance_imp %>% unique() %>%
as.numeric() %>% scales::percent())) %>%
ggplot(aes(step, value, colour = factor(chance_imp))) +
geom_smooth() +
facet_wrap(vars(name)) +
labs(y = "gini",
colour = "importance of chance",
caption = "n = 100 agents")
p
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'

plotly::ggplotly(p)
## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'